<%@ page pageEncoding="UTF-8"%>
<%@ taglib prefix="isperp" uri="/WEB-INF/tlds/isperp.tld"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>

<script type="text/javascript">
	function statusFormatter(cellvalue, rowid, type) {
		if (type == 1) {
			if (cellvalue == '是')
				return "<img title='任务延期' src='img/incident/unusual.png'>";
			else
				return "";
		} else if (type == 2) {
			if (cellvalue == '一级')
				return "<img title='优先级：1级' src='img/incident/p1.png'>";
			else if (cellvalue == '二级')
				return "<img title='优先级：2级' src='img/incident/p2.png'>";
			else if (cellvalue == '三级')
				return "<img title='优先级：3级' src='img/incident/p3.png'>";
			else if (cellvalue == '四级')
				return "<img title='优先级：4级' src='img/incident/p4.png'>";
			else
				return "<img title='优先级：5级' src='img/incident/p5.png'>";
		}

	}
</script>
<isperp:grid url="problem/search/list" gridId="problemSearchGrid"
	ondbClickRowEvent="problemGrid.edit(rowid);" sortname="create_date" sortorder="desc"
	cusDeleteUrl="problem/problem/delete" cusViewUrl="problem/problem/view"
	excelExportUrl="problem/problem/excelExport">

	<jsp:attribute name="toolbar">
	<isperp:toolbar id="userToolbar">
	
	</isperp:toolbar>
	</jsp:attribute>

	<jsp:attribute name="searchbar">
	<table class="search-table">
	<tbody>
		<tr>
			<td class="td1">编号：</td>
			<td class="td2"><input type="text" field="code" op="cn">
			</td>
			<td class="td1">标题：</td>
			<td class="td2"><input type="text" field="title" op="cn">
			</td>
			
			<td class="td1">分类：</td>
				<td class="td2"><input type="hidden" id="probCategoryId"
						field="prob_category_id" op="cn" /> <isperp:treeSelector
							url="incident/category/getTree" id="probCategorySelector"
							name="probCategoryName" displayValue=""
							valueControlId="probCategoryId"></isperp:treeSelector>
					</td>
			
			
			
		</tr>
		
	
		  
		<tr>
		    <td class="td1">优先级：</td>
			<td class="td2"><form:select path="var_priority"
							field="priority_name" data-allow-empty="true" op="cn"
							items="${var_priority}" itemLabel="name" itemValue="name" />
			</td>
			<td class="td1">请求人：</td>
			<td class="td2"><form:select path="requesters" field="requester"
							op="cn" items="${requesters}" itemLabel="fullname"
							itemValue="name" data-allow-empty="true" cssClass="search" />
			</td>
			 <td class="td1">请求日期：</td>
			<td class="td2"><input id="requestDateStart" type="date"
						field="request_date" op="gt" style="width: 68px" />~<input
						id="requestDateEnd" type="date" field="request_date" op="lt"
						style="width: 68px" />
			</td>
			
			
		</tr>
		
		
		<tr>
		   <td class="td1">实施者：</td>
			<td class="td2"><form:select path="executers"
							field="executer_name" op="cn" items="${executers}"
							itemLabel="fullname" itemValue="fullname" data-allow-empty="true"
							cssClass="search" />
			</td>
			<td class="td1">实施日期：</td>
			<td class="td2"><input id="executeTimeStart" type="date"
						field="execute_time" op="gt" style="width: 68px" />~<input
						id="executeTimeEnd" type="date" field="execute_time" op="lt"
						style="width: 68px" />
			</td>
			<td class="td1">问题状态：</td>
			<td class="td2"><form:select path="problem_status"
							field="status" op="eq" data-allow-empty="true"
							items="${problem_status}" itemLabel="name" itemValue="name" />
			</td>
		</tr>
		
			<tr>
			
			<td class="td1">是否延期：</td>
			<td class="td2" colspan="5"><input type="radio"
						field="sla_status" op="in" name="group1" value="1,0" checked />全部 <input
						type="radio" field="sla_status" op="eq" name="group1" value="1" />是<input
						type="radio" field="sla_status" op="eq" name="group1" value="0" />否
			</td>
			
		</tr>
		<c:if test="${dataRange!=22 && dataRange!=33 }">
		  <tr>
		    <td class="td1">所属项目：</td>
			<td class="td2" colspan="5"><form:select path="projects"
								field="project_id" op="cn" data-allow-empty="true"
								items="${projects}" itemLabel="name" itemValue="id"
								cssClass="search" />
			</td>
		</tr>
		</c:if>
		
		
	</tbody>
	</table>
	</jsp:attribute>
	<jsp:body>
	<isperp:column name="id" title="id" hidden="true">
	</isperp:column>
	<isperp:column name="priority_name" title="" width="18"
			isFormatterFun="true"
			formatter="return statusFormatter(cellvalue,rowObject.id,2);">
	</isperp:column>
	<isperp:column name="code" title="编号" width="100">
	</isperp:column>
	<isperp:column name="title" title="标题" width="180">
	</isperp:column>
	<isperp:column name="requester_name" title="请求人" width="90">
	</isperp:column>
	<isperp:column name="request_date" title="请求日期" width="90">
	</isperp:column>
	<isperp:column name="prob_category_name" title="分类" width="140">	
	</isperp:column>
	<isperp:column name="executer_name" title="实施者" width="80">
	</isperp:column>
	<isperp:column name="execute_time" title="实施日期" width="80">
	</isperp:column>
	<isperp:column name="status" title="状态" width="60">
	</isperp:column>
	</jsp:body>

</isperp:grid>

<isperp:operate code="TSK_SEARCH"></isperp:operate>

